import {defineStore} from "pinia"
import {ref} from 'vue'
import {getCustomCoordinate} from "@/common/index.js"


export const useUserStore = defineStore('user',() => {
	const userInfo  = ref(null)
	
	/**
	 * 根据token获取用户信息，get相对的是后端来说，不是当前的store
	 */
    function getUserInfo(){
		
	}
	
	
	const userCurrentCoordinate = ref({longitude:null,latitude:null})
	async function getCoordinate() {
		userCurrentCoordinate.value = await getCustomCoordinate()
		return userCurrentCoordinate // emmmm
	}
	
	return {
		userCurrentCoordinate,
		getCoordinate
	}
})